package demo;

import com.sun.jersey.core.util.Base64;
import com.sun.jna.Native;
import com.sun.jna.win32.StdCallLibrary;


/**
 * Created by zhangbn on 2018/09/29.
 */
public class JnaDll {

    public interface Dll extends StdCallLibrary {

        Dll INSTANCE = (Dll) Native.loadLibrary("others/st_feature_comp.dll", Dll.class);

        public int st_feature_comp(Object f1, Object f2, int len, float sim, int verbose);

        public String get_version();
    }

    public static void main(String[] args) {

        long beginLong = System.currentTimeMillis();

        String feature1 = "7qpXQideAAAAAQAAdl0PvUlcz71I43g9FQS7PcWFeb0COZ47A4f4vHcvU719D547n9JVPSthOL2NyqE8g/nyvcG41L1EMSa9gW6DPdZtCjzasRK9NsMpvftgAL5mIpe9MHP1PYNaN71v0+E8vpUZvepLmTwfLp09JqKauxoHy70LvOi8BN6TveTV9T3azsK8jMmZvYip07xhxrC8ueMjvbo17D1cHT294cAcvX5lhT2tAsW9XwWRPbD/Kb3US3C9zIcHPWG4aL3Bqhq9WBEBvOWHkTw+IwU9OUuCvTUl7j2d9RA7iPXvPNuhi72pWRo8xBXaPc7x+r1PT249xsu+PYW0tLufsJe9Si/6PG/ntr3hLAm85zIlvGQaH72Yhds9pf4QPW1FgD1oiBA85IKtvKLWOz3qcNq7SuhdPYXxPj0/1cs8OjdJPYDQar0bEvu8BEvXO4fqzjyTQYi8pKOhPQPhSzzvtmo9o075PCz59bmm+589JUaNPcRvxz18bD8+WJKSPTRzpr2BRTs9yV+hPKxxaD2XJ2M9kHRgvYhSM70WTai6n+AQPWfae7q7LtA9md1qPTU1dTwRpQs7l7ScvbfL9z2onOs9cC2cu4GYGL5MKKa9/KnQvO3dGr2sOku9eNkLPU4TDj1zzx+64/zDPYcC57zdoxu9ngm6vZajf70qRe67PiYAPLFcqDzDt768fQCWPYZeWT3CpIe9kvPHvPZtWLysmZ0976GcPDKCsj1cVDa8p49Zu+4qh7yQ4oI7JA8NPk+OiL28NEy89SQnvBw4rr18Ocw96y8BPce3kT1SOh885+3XPUUx2z2WSOC9gaJcv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i96re/vTKmYDwKb/i9TzUDPhLXkDxaa208TlQFPUErGjx+8Fe75mEavXGPLrqPbqs9HcBfuvFbsb1eBn+9AipQO79nUTyH45a9pELNPMfNKz2vxQI+6khpvVJvg73L3mg9ydMpPRQ1p72/V0I9HW2rvVJl3TzCG648z1XwPA79wjxy9f89MpdcvV/5rjziSU48kBHlPToG/D2mgVC9PlWNu5yyhj1aBi89b2iFvca6O72aBZo9T90HvdfOWz228IY8mUlwPcNdN7ze0Ms9OeQiPQwvl70azEM9oGcOvicXkj2PP/+8uqfmvI3pNb23peg8cgQFvQ3oHT3KjhO96z7xPQd8Kz2C7xw8IOnHvd7RVj37ehI8uEUKvTsxhTyooSC9XGQbvQQljb1r5AG8+0sLO9tGd7p16Kc8hijdPT780LzX/e+96QZrPRxdzjynmNq8+cuAPRw2+rxYY6c8VQN8vUknDLwrXQO9YKttPb74e7ydSp28fip6vQjfEL3edyc8btCCvGOfoj2QukO9fsMqve3BNrxThwY95mkKvNgHj7zJoeM7WsuGveYarr3XE8Y9e15XO4Ht6L0zO8s65D4/usJaIL51zq48mEZWOzx/tj1V9+G9v7u+PXszoT0Db3i93cTAPf/dMbyXx/u8NQQ9O9h2GbyyaLg9iaCFPNoIYDz0FO48tR79O+ZVnL1G8qu9AXU6vQdZY7339xW+zb4jvaTkIj2oyJQ9p/pzvUy5xLxvinI91R6PvfrDx70395w9JpcrvdUzyD3cGc89QMcpPlS/er1XI7I8GZBsOpuTObshcUC9g1+UPbBhdj1MZ6W953hqPQ==";

        byte[] var1 = Base64.decode(feature1);
        byte[] var2 = Base64.decode(feature2);

        int a = Dll.INSTANCE.st_feature_comp(var1, var2, 10000, 0.1f, 0);

        System.out.println(a);

        long endLong = System.currentTimeMillis();
        System.out.println("所消耗的时间:\t " + (endLong - beginLong));

    }

}